/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package zad3.ComplexNumbers.src.complexnumber;

/**
 *
 * @author s351769
 */
public class ComplexNumber {
    
    private double re, im;

    public ComplexNumber(double d) {
        re = d;
        im = 0.0;
    }

    public ComplexNumber() {
        re = im = 0.0;
    }
    
    public ComplexNumber(double d, double d1) {
        re = d;
        im = d1;
    }

    public double getRealPart() {
        return re;
    }

    public double getImaginaryPart() {
        return im;
    }

    public ComplexNumber getConjugate() {
        return new ComplexNumber(re, -im);
    }

    @Override
    public boolean equals(Object o) {
        if (o.getClass() != ComplexNumber.class) return false;
        ComplexNumber comp = (ComplexNumber) o;
        if (this.re == comp.re && this.im == comp.im) return true;
        else return false;
    }
}
